import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "../views/Home.vue"
import  Main  from '../views/Main.vue'
import  Login from '../views/Login.vue'
import  Register from '../views/Register.vue'
import  Forget from '../views/Forget.vue' 
import Auth from '../views/Auth.vue'
import Notfound from '../views/Notfound.vue'


import User1 from "../views/users/User1.vue"
import User2 from "../views/users/User2.vue"
import User3 from "../views/users/User3.vue"
import User4 from "../views/users/User4.vue"

import Allorders from "../views/aftersellperson/Allorders.vue"
import Problemview from '../views/aftersellperson/Problemview.vue'

import Roles from "../views/administrativestaff/Roles.vue"
import UserManagement  from '../views/administrativestaff/UserManagement.vue'
import Permission from '../views/administrativestaff/Permission'
import Journal from '../views/administrativestaff/Journal.vue'

Vue.use(VueRouter)

const routes = [
  //path是用来指定当前路由所匹配的URL模式,name对当前路由的一个命名,component是用来指定当前路由要展示哪个组件的
  //主路由 component写地址
    {path:'/',name:'Main',component:Main,
     redirect:'/Home', //重定向到主页
     children:[
      //子路由,caseSensitive: true url区分大小写
        { path: '/Home',name:'Home',component: Home,caseSensitive: true,meta:{title: '首页'}},
        { path: '/Auth',name:'Auth',component: Auth,caseSensitive: true,meta:{title: '无权访问'}},

        { path: '/User1',name:'User1', component: User1,caseSensitive: true,meta:{title: '已拥有软件'}},
        { path: '/User2',name:'User2', component: User2,caseSensitive: true,meta:{title: '问题反馈'}},
        { path: '/User3',name:'User3', component: User3,caseSensitive: true,meta:{title: '查看处理状态'}},
        { path: '/User4',name:'User4', component: User4,caseSensitive: true,meta:{title: '个人信息'}},

        //售后人员
        { path: '/Allorders',name:'Allorders', component: Allorders,caseSensitive: true,meta:{title: '全部订单'}},
        { path: '/Problemview',name:'Problemview', component: Problemview,caseSensitive: true,meta:{title: '问题查看'}},

        //管理人员
        { path: '/Roles',name:'Roles', component: Roles,caseSensitive: true,meta:{title: '角色管理'}},
        { path: '/UserManagement',name:'UserManagement', component: UserManagement ,caseSensitive: true,meta:{title: '用户管理'}},
        { path: '/Permission',name:'Permission', component: Permission ,caseSensitive: true,meta:{title: '权限管理'}},
        { path: '/Journal',name:'Journal', component: Journal,caseSensitive: true,meta:{title: '日志'}},
     ]
    },
    {path:'/Login',name:'Login',component:Login,caseSensitive: true},
    {path: '/Register',name:'Register',component:Register,caseSensitive: true},
    {path: '/Forget',name:'Forget',component:Forget,caseSensitive: true},
    {path: '*',name:'Notfound',component: Notfound,caseSensitive: true},
    
  ]
  
const router = new VueRouter({
    routes,// (缩写) 相当于 routes: routes
     
})


export default router